
package model;

import view.VendaIngressoView;

/**
 * @author NootFer
 */
public class MudaBanner implements Runnable {
    
    private VendaIngressoView view;
    private int i = 2;
    
    public void setView(VendaIngressoView view) {
        this.view = view;
        System.out.println(view);
    }
    
    @Override
    public void run() {
        while(true) {
            try { 
                Thread.sleep(3000);
            } catch(Exception e) { }
            if (i == 1) {
                this.view.setBanner("/resources/img1.jpeg");
            } else if (i == 2) {
                this.view.setBanner("/resources/img2.jpeg");
            } else if (i == 3) {
                this.view.setBanner("/resources/img3.jpeg");
            } else {
                this.view.setBanner("/resources/img4.jpeg");
                i = 0;
            }
            i++;
        }
    }    
}
